{% extends "base.html" %}
{% load i18n %}

{% block precontent %}
<div id="toolbar-welcome">
{% if user.is_authenticated %}
	Signed in as <a href="{% url plans.views.profile %}">{{ user.username }}</a>. <a href="{% url auth_logout %}">Sign out</a>
{% else %}
	<a href="{% url auth_login %}?next=/">Sign in</a>
	{% endif %}
</div>
{% endblock %}
{% block content %}
<div id="profile">
	<div>
		<h1>Your profile</h1>
		<ul>
			<li>User name: {{ user.username }}</li>
			<li>E-mail address: {{ user.email }}</li>
			<li>Last login: {{ user.last_login|date:"D d M Y, H:i" }} </li>
			<li>Member since: {{ user.date_joined|date:"D d M Y, H:i" }} </li>
			<li><a href="{% url auth_password_change %}">Change my password</a></li>
		</ul>
	</div>
	<div>
		<h1>Recent plans</h1>
		{{ req }}
{% if profile.plans.all|length_is:"0" %}
	None, unfortunately.
{% else %}
		<ul>
	{% for plan in profile.plans.all %}
			<li><a href="/{{ plan.hash }}">{{ plan }}</a></li>
	{% endfor %}
		</ul>
		<a href="?clear" onclick="javascript:return confirm('Really delete your history?')">Clear the list</a>
	</div>
</div>
{% endif %}
{% endblock %}
